//
//  WGMingYiCollectionViewCell.m
//  QuickCure1
//
//  Created by Apple on 16/11/1.
//  Copyright © 2016年 maoge. All rights reserved.
//

#import "WGMingYiCollectionViewCell.h"

@interface WGMingYiCollectionViewCell ()
@property (weak, nonatomic) IBOutlet UIImageView *iv_heart;

@end

@implementation WGMingYiCollectionViewCell

-(void)awakeFromNib{
    [super awakeFromNib];
    
    [self setHeartImageViewAnimation];
}


#pragma
#pragma mark - 设置天气图片的动画
-(void)setHeartImageViewAnimation{
    
    NSTimer *timer = [NSTimer timerWithTimeInterval: 1 repeats:YES block:^(NSTimer * _Nonnull timer) {
        
        //1.创建动画
        CABasicAnimation *am = [CABasicAnimation animationWithKeyPath:@"transform.scale"];
        
        //2.设置动画的属性
//        CGFloat angle = M_PI * 2;
//        
//        am.fromValue = [NSNumber numberWithFloat:angle];
        am.toValue = [NSNumber numberWithFloat:1.4];
        
        am.repeatCount = CGFLOAT_MAX;
        
        am.fillMode = kCAFillModeForwards;
        am.removedOnCompletion = NO;
        
        am.duration = 1;
        
        
        //3.添加动画
        [self.iv_heart.layer  addAnimation:am forKey:@"123"];
        
        
    }];
    
    [[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
    
}


@end
